package com.top10.controller;

import com.top10.bean.ResponseBean;
import com.top10.entity.CarCoupons;
import com.top10.service.impl.CarCouponsServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/carcoupons")
public class CardCouponsController {

	@Autowired
	private CarCouponsServiceImpl carCouponsService;

	@RequestMapping(value = "/getcarcoupons",method = RequestMethod.POST)
	@ResponseBody
	public ResponseBean getCarCoupons(String shop_uuid)throws Exception{
		if(shop_uuid == null){
			return ResponseBean.createError("输入的参数为空");
		}
		List<CarCoupons> carCouponsList=carCouponsService.getCarCoupons(shop_uuid);
		return ResponseBean.createSuccess().addData("carCouponsList",carCouponsList);
	}
}
